{php include pubTemplate("header_admin")}
<script src="public/js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{SITE_URL}public/js/jquery.upload.v2.js"></script>

<script>
    $(function(){
        $("#upload").upload({
            action: "{SITE_URL}index.php?app=system&ac=logo", //上传地址
            fileName: "filedata",    //文件名称。用于后台接收
            params: {},         //参数
            accept: ".jpg,.png,.gif",     //文件类型
            complete: function (rs) {  //上传完成
				$("#logo img").attr("src",rs);
            },
            submit: function () {   //提交之前
                //alert("submit");
            }
        });
    })
</script>

<div class="midder">
{template menu}
<form method="POST" action="index.php?app=system&ac=options&ts=do">

<h6>常规选项</h6>

<table class="table table-hover">
    <tbody>
<tr><td width="200">网站标题：</td><td><input type="text" style="width:300px;" name="option[site_title]" value="{$strOption[site_title]}" /></td></tr>
<tr><td>副标题：</td><td><input type="text" style="width:300px;" name="option[site_subtitle]" value="{$strOption[site_subtitle]}" /> (例如：又一个ThinkSAAS社区小组)</td></tr>

<tr><td>关键词：</td><td><input type="text" style="width:300px;" name="option[site_key]" value="{$strOption[site_key]}" /> (关键词有助于SEO)</td></tr>

<tr><td>网站说明：</td><td><textarea type="text" style="width:300px;height:50px;font-size:12px;" name="option[site_desc]">{$strOption[site_desc]}</textarea> (用简洁的文字描述本站点。)</td></tr>

<tr><td>站点地址（URL）:</td><td><input type="text" style="width:300px;" name="option[site_url]" value="{$strOption[site_url]}" />(必须以http://开头，以/结尾。如果采用相对路径，请只填写/)</td></tr>

<tr><td>固定地址:</td><td><input type="text" style="width:300px;" name="option[link_url]" value="{$strOption[link_url]}" />(例如：http://www.thinksaas.cn/，必须以/结尾，主要用于采用固定链接的URL)</td></tr>

    <tr><td>网站密钥:</td><td><input id="sitepkey" type="text" style="width:300px;" name="option[site_pkey]" value="{$strOption[site_pkey]}" /> <a href="javascript:void(0)" onclick="reSitePkey('{php echo md5(rand())}')">重新生成</a> <span style="color: red;">(非常重要，切勿泄漏)</span></td></tr>

<tr><td>网站Logo:</td><td>
<div id="logo"><img src="{SITE_URL}uploadfile/logo/{$strOption['logo']}" width="190" height="40" /></div>
<input type="button" value="点击上传" id="upload" />(支持png,gif,jpg格式，宽度285px高度60px)</td></tr>

<tr><td>电子邮件 :</td><td><input type="text" style="width:300px;" name="option[site_email]" value="{$strOption[site_email]}" /></td></tr>

<tr><td>ICP备案号 :</td><td><input type="text" style="width:300px;" name="option[site_icp]" value="{$strOption[site_icp]}" /> （京ICP备09050100号）</td></tr>

<tr><td>是否上传头像 :</td><td>
    <input type="radio" {if $strOption[isface]=='0'}checked="select"{/if} name="option[isface]" value="0" />不需要 
    <input type="radio" {if $strOption[isface]=='1'}checked="select"{/if} name="option[isface]" value="1" />需要
</td></tr>

<tr><td>用户注册 :</td><td>
    <input type="radio" {if $strOption[isinvite]=='0'}checked="select"{/if} name="option[isinvite]" value="0" />开放注册 
    <input type="radio" {if $strOption[isinvite]=='1'}checked="select"{/if} name="option[isinvite]" value="1" />邀请注册
    <input type="radio" {if $strOption[isinvite]=='2'}checked="select"{/if} name="option[isinvite]" value="2" />关闭注册
</td></tr>

<tr><td>注册方式 :</td><td>
    <input type="radio" {if $strOption['regtype']=='0'}checked="select"{/if} name="option[regtype]" value="0" />Email邮箱
    <input type="radio" {if $strOption['regtype']=='1'}checked="select"{/if} name="option[regtype]" value="1" />手机号
    <input type="radio" {if $strOption['regtype']=='2'}checked="select"{/if} name="option[regtype]" value="2" />Email邮箱+手机号
    <small class="text-danger">(手机号注册需要先安装手机号注册功能)</small>
</td></tr>


<tr><td>是否开启短信登录:</td><td>
    <input type="radio" {if $strOption[isplogin]=='0'}checked="select"{/if} name="option[isplogin]" value="0" />不开启
    <input type="radio" {if $strOption[isplogin]=='1'}checked="select"{/if} name="option[isplogin]" value="1" />开启
</td></tr>


<tr><td>是否验证Email :</td><td>
    <input type="radio" {if $strOption[isverify]=='0'}checked="select"{/if} name="option[isverify]" value="0" />不验证Email 
    <input type="radio" {if $strOption[isverify]=='1'}checked="select"{/if} name="option[isverify]" value="1" />验证Email
</td></tr>


<tr><td>是否验证手机号 :</td><td>

    <input type="radio" {if $strOption[isverifyphone]=='0'}checked="select"{/if} name="option[isverifyphone]" value="0" />不验证手机号
    <input type="radio" {if $strOption[isverifyphone]=='1'}checked="select"{/if} name="option[isverifyphone]" value="1" />验证手机号

    <small class="text-danger">(手机号验证后同时可以使用手机号登录网站，注册方式中使用手机号注册的自动验证)</small>

</td></tr>

<tr><td>登录是否跳转 :</td><td><input type="radio" {if $strOption[istomy]=='0'}checked="select"{/if} name="option[istomy]" value="0" />不跳转 <input type="radio" {if $strOption[istomy]=='1'}checked="select"{/if} name="option[istomy]" value="1" />跳转到我的社区</td></tr>


<tr><td>是否开启验证码 :</td><td><input type="radio" {if $strOption[isauthcode]=='0'}checked="select"{/if} name="option[isauthcode]" value="0" />不开启 <input type="radio" {if $strOption[isauthcode]=='1'}checked="select"{/if} name="option[isauthcode]" value="1" />开启</td></tr>


    <tr><td>是否token验证 :</td><td><input type="radio" {if $strOption[istoken]=='0'}checked="select"{/if} name="option[istoken]" value="0" />否 <input type="radio" {if $strOption[istoken]=='1'}checked="select"{/if} name="option[istoken]" value="1" />是</td></tr>



<tr><td>是否开启公众平台登录:</td><td>

    <div>
        <input type="radio" {if $strOption['is_weixin']=='0'}checked="select"{/if} name="option[is_weixin]" value="0" />否 
        <input type="radio" {if $strOption['is_weixin']=='1'}checked="select"{/if} name="option[is_weixin]" value="1" />是 <small class="text-danger">(请先获取微信公众号所需要的参数，<a class="font-weight-bold" target="_blank" href="https://mp.weixin.qq.com/">点击去获取</a>)</small>
    </div>


    <div id="weixin_option" {if $strOption['is_weixin']=='0' || $strOption['is_weixin']==''}style="display: none;"{/if}>
    
        <div class="d-flex mt-2">
            <div style="width: 80px;">AppID：</div>
            <div><input style="width:300px;" type="text" name="option[weixin_appid]" value="{$strOption['weixin_appid']}"></div>
        </div>

        <div class="d-flex mt-2">
            <div style="width: 80px;">AppSecret：</div>
            <div><input style="width:300px;" type="text" name="option[weixin_appsecret]" value="{$strOption['weixin_appsecret']}"></div>
        </div>

    </div>


</td></tr>



<tr><td>是否开启人机验证 :</td><td>

    <div>
        <input type="radio" {if $strOption['is_vaptcha']=='0'}checked="select"{/if} name="option[is_vaptcha]" value="0" />否 
        <input type="radio" {if $strOption['is_vaptcha']=='1'}checked="select"{/if} name="option[is_vaptcha]" value="1" />是 <small class="text-danger">(请先获取人机验证所需要的参数，<a class="font-weight-bold" target="_blank" href="https://www.vaptcha.com/">点击去获取</a>)</small>
    </div>


    <div id="vaptcha_option" {if $strOption['is_vaptcha']=='0'}style="display: none;"{/if}>
    
        <div class="d-flex mt-2">
            <div style="width: 40px;">VID：</div>
            <div><input style="width:300px;" type="text" name="option[vaptcha_vid]" value="{$strOption['vaptcha_vid']}"></div>
        </div>

        <div class="d-flex mt-2">
            <div style="width: 40px;">KEY：</div>
            <div><input style="width:300px;" type="text" name="option[vaptcha_key]" value="{$strOption['vaptcha_key']}"></div>
        </div>

    </div>


</td></tr>






<tr><td>时区:</td><td>
<select name="option[timezone]">
{loop $arrTime $key $item}
<option {if $key==$strOption[timezone]}selected="selected"{/if} value="{$key}">{$item}</option>
{/loop}
</select>
</td>
</tr>


    </tbody>
</table>



<h6>内容设定</h6>

    <table class="table table-hover">
        <tbody>



        <tr><td  width="200">用户访问内容权限：</td><td>
            <input type="radio" name="option[visitor]" value="0" {if $strOption['visitor']=='0'}checked="select"{/if} />不需要登录
            <input type="radio" name="option[visitor]" value="1" {if $strOption['visitor']=='1'}checked="select"{/if} />需要登录
        </td></tr>




        <tr><td>用户发布内容权限：</td><td>
            <input type="radio" name="option[publisher]" value="0" {if $strOption['publisher']=='0'}checked="select"{/if} />注册用户
            <input type="radio" name="option[publisher]" value="isverify" {if $strOption['publisher']=='isverify'}checked="select"{/if} />仅Email验证用户
            <input type="radio" name="option[publisher]" value="isverifyphone" {if $strOption['publisher']=='isverifyphone'}checked="select"{/if} />仅手机注册用户
            <input type="radio" name="option[publisher]" value="isrenzheng" {if $strOption['publisher']=='isrenzheng'}checked="select"{/if} />仅手工认证用户
            <input type="radio" name="option[publisher]" value="isadmin" {if $strOption['publisher']=='isadmin'}checked="select"{/if} />仅管理员
        </td></tr>


        <tr><td>用户发布内容时间 :</td><td><textarea style="width:500px;" type="text" name="option[pubtime]">{$strOption['pubtime']}</textarea> <br />(24小时制，以|分割。留空为不限制)</td></tr>


        <tr><td>发布内容间隔时间 :</td><td><input type="text" name="option[timeblank]" value="{$strOption['timeblank']}"> <small class="text-danger">(0不限制；例如1分钟=60秒，30分钟就是30*60=1800秒；1小时3600秒)</small></td></tr>


        <tr><td>用户修改内容权限 :</td><td><input type="radio" {if $strOption['isallowedit']=='0'}checked="select"{/if} name="option[isallowedit]" value="0" />允许 <input type="radio" {if $strOption['isallowedit']=='1'}checked="select"{/if} name="option[isallowedit]" value="1" />不允许 (管理员除外)</td></tr>


        <tr><td>用户删除内容权限 :</td><td><input type="radio" {if $strOption['isallowdelete']=='0'}checked="select"{/if} name="option[isallowdelete]" value="0" />允许 <input type="radio" {if $strOption['isallowdelete']=='1'}checked="select"{/if} name="option[isallowdelete]" value="1" />不允许 (管理员除外)</td></tr>


        <tr><td ></td><td></td></tr>
        </tbody>
    </table>


<h6>系统主题</h6>

    <table class="table table-hover">
        <tbody>
<tr>
<td  width="200">选择主题：</td>

<td>

<div class="theme">
<ul>
{loop $arrTheme $key $item}
<li>
<img src="theme/{$item}/preview.jpg">
<br />
<input type="radio" {if $strOption[site_theme]==$item}checked="select"{/if} name="option[site_theme]" value="{$item}" /> {$item}
</li>
{/loop}
</ul>
</div>

</td>
</tr>
        </tbody>
</table>


<h6>链接形式</h6>

    <table class="table table-hover">
        <tbody>
    <tr>
	<td  width="200">形式1：</td><td><input type="radio" {if $strOption[site_urltype]==1}checked="select"{/if} name="option[site_urltype]" value="1" /> index.php?app=group&ac=show&id=1</td></tr>
    <tr><td>形式2：</td><td><input type="radio" {if $strOption[site_urltype]==2}checked="select"{/if} name="option[site_urltype]" value="2" /> index.php/group/show/id-1</td></tr>
	<tr><td>形式3：</td><td><input type="radio" {if $strOption[site_urltype]==3}checked="select"{/if} name="option[site_urltype]" value="3" /> group-show-id-1.html </td></tr>
	<tr><td>形式4：</td><td><input type="radio" {if $strOption[site_urltype]==4}checked="select"{/if} name="option[site_urltype]" value="4" /> group/show/id-1 </td></tr>
<tr><td>形式5：</td><td><input type="radio" {if $strOption[site_urltype]==5}checked="select"{/if} name="option[site_urltype]" value="5" /> group/show/1 </td></tr>
<tr><td>形式6：</td><td><input type="radio" {if $strOption[site_urltype]==6}checked="select"{/if} name="option[site_urltype]" value="6" /> group/show/id/1 </td></tr>
<tr><td>形式7：</td><td><input type="radio" {if $strOption[site_urltype]==7}checked="select"{/if} name="option[site_urltype]" value="7" /> group/show/1/ </td></tr>


</tbody>
</table>


    <div class="alert alert-info">默认支持Apache环境的rewrite，如果是nginx环境，请点击查看 <a class="font-weight-bold" target="_blank" href="https://www.thinksaas.cn/article/show/13/">ThinkSAAS社区URL重写规则之Nginx篇</a></div>


<h6>其他选项</h6>
    <table class="table table-hover">
        <tbody>


<tr><td>文件存储方式：<br><span class="text-danger font-weight-bold">【重要：用户上传数据后切勿来回切换存储方式，后果自负！如本地存储数据需要上云存储，请联系ThinkSAAS官方指导处理！】</span></td><td>


    <input type="radio" {if $strOption['file_upload_type']=='0'}checked="select"{/if} name="option[file_upload_type]" value="0" /> 本地存储 
    <input type="radio" {if $strOption['file_upload_type']=='1'}checked="select"{/if} name="option[file_upload_type]" value="1" /> 阿里云(对象存储OSS)


    <div id="alioss_option" {if $strOption['file_upload_type']=='0' || $strOption['file_upload_type']==''}style="display: none;"{/if}>

        <hr />

        <div class="text-danger">
            使用阿里云(对象云存储OSS)，需要购买阿里云对象存储，<a class="font-weight-bold" target="_blank" href="https://www.aliyun.com/minisite/goods?userCode=t0dihnz2">点击去购买</a>，并获取以下参数。
        </div>
    
        <div class="d-flex mt-2">
            <div style="width: 180px;">AccessKey ID：</div>
            <div><input style="width:300px;" type="text" name="option[alioss_accesskey_id]" value="{$strOption['alioss_accesskey_id']}"></div>
            
        </div>

        <div class="d-flex mt-2">
            <div style="width: 180px;">AccessKey Secret：</div>
            <div><input style="width:300px;" type="text" name="option[alioss_accesskey_secret]" value="{$strOption['alioss_accesskey_secret']}"></div>
        </div>


        <div class="d-flex mt-2">
            <div style="width: 180px;">Bucket 名称：</div>
            <div><input style="width:300px;" type="text" name="option[alioss_bucket]" value="{$strOption['alioss_bucket']}"></div>
            <div class="ml-2 c9">例如：thinksaas</div>
        </div>

        <div class="d-flex mt-2">
            <div style="width: 180px;">Endpoint（地域节点）：</div>
            <div><input style="width:300px;" type="text" name="option[alioss_endpoint]" value="{$strOption['alioss_endpoint']}"></div>
            <div class="ml-2 c9">例如：https://oss-cn-beijing.aliyuncs.com</div>
        </div>

        <div class="d-flex mt-2">
            <div style="width: 180px;">Bucket 域名：</div>
            <div><input style="width:300px;" type="text" name="option[alioss_bucket_url]" value="{$strOption['alioss_bucket_url']}"></div>
            <div class="ml-2 c9">例如：https://thinksaas.oss-cn-beijing.aliyuncs.com</div>
        </div>


    </div>


</td></tr>


<tr><td width="200">图片上传大小：</td><td><input name="option[photo_size]" value="$strOption['photo_size']" />M (请填写数字，例如2)</td></tr>
<tr><td>图片上传格式：</td><td><input name="option[photo_type]" value="$strOption['photo_type']" />(请以英文逗号分割，例如：jpg,gif,png)</td></tr>

<tr><td>是否开启正文图片检测：</td><td>


    <input type="radio" {if $strOption['photo_check']=='0'}checked="select"{/if} name="option[photo_check]" value="0" />不开启 
    <input type="radio" {if $strOption['photo_check']=='1'}checked="select"{/if} name="option[photo_check]" value="1" />开启

</td></tr>


<tr><td>图片处理组件：</td><td>

    <input type="radio" {if $strOption['photo_driver']=='gd'}checked="select"{/if} name="option[photo_driver]" value="gd" />gd 
    <input type="radio" {if $strOption['photo_driver']=='imagick'}checked="select"{/if} name="option[photo_driver]" value="imagick" />imagick <small class="text-danger">(服务器和php环境必须支持imagick扩展)</small>

</td></tr>


<tr><td>附件上传大小：</td><td><input name="option[attach_size]" value="$strOption['attach_size']" />M (请填写数字，例如2)</td></tr>
<tr><td>附件上传格式：</td><td><input name="option[attach_type]" value="$strOption['attach_type']" />(请以英文逗号分割，例如：zip,rar,doc,txt,ppt)</td></tr>



    <tr><td>用户每日获得积分上限:</td><td><input name="option[dayscoretop]" value="{$strOption['dayscoretop']}" /> 积分（设置每日获得积分上限后，用户当天的内容动作不再获得积分奖励。）</td></tr>



<tr><td></td><td><input type="submit" class="btn btn-primary" value="提交修改" /></td></tr>
        </tbody>
</table>


</form>
</div>
<script>
    function reSitePkey(value) {
        $("#sitepkey").val(value);
    }

    //微信公众号选项
    $('input[name="option[is_weixin]"]').click(function(){
        var value  = $('input[name="option[is_weixin]"]:checked').val();
        if(value=='1'){
            $("#weixin_option").show()
        }else if(value=='0'){
            $("#weixin_option").hide()
        }
    });

    //人机验证选项
    $('input[name="option[is_vaptcha]"]').click(function(){
        var value  = $('input[name="option[is_vaptcha]"]:checked').val();
        if(value=='1'){
            $("#vaptcha_option").show()
        }else if(value=='0'){
            $("#vaptcha_option").hide()
        }
    });

    //文件存储选项
    $('input[name="option[file_upload_type]"]').click(function(){
        var value  = $('input[name="option[file_upload_type]"]:checked').val();
        if(value=='1'){
            $("#alioss_option").show()
        }else if(value=='0'){
            $("#alioss_option").hide()
        }
    });

</script>
{php include pubTemplate("footer_admin")}